package com.feicheng.house.controller.customer;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import com.feicheng.house.entity.Client;
import com.feicheng.house.result.ResultInfo;
import com.feicheng.house.service.IClientService;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-11-25
 */
@RestController
@RequestMapping("/customer/client")
public class CustomerClientController {
	@Autowired
	IClientService iClientService;
	
	
	/**
	 * 新增客户
	 * @param Client 新增客户对象
	 * @return Boolean值
	 */
	@PostMapping("/info")
	public ResultInfo insert(@RequestBody Client client) {
		return iClientService.insert(client);
	}
	/**
	 * 修改客户
	 * @param Client 修改客户
	 * @return Boolean值
	 */
	@PutMapping("/info")
	public ResultInfo update(@RequestBody Client client) {
		return iClientService.update(client);
	}
	/**
	 * 查询客户
	 * @param openId 
	 * @return client
	 */
	@GetMapping("/info")
	public ResultInfo getClient(String openId) {
		return iClientService.getClient(openId);
	}

}

